﻿using FlowCanvas.Nodes;

namespace Yoozoo.Gameplay.Liberty.StreetEvent
{
    public class StreetEventSwitchCheckPoint: CallableActionNode<bool>
    {
        public override void Invoke(bool enable)
        {
            var vehicleRacingMgr = StreetEventManager.GetInstance("StreetEventManager").vehicleRacingManager;
            if (vehicleRacingMgr)
            {
                if (vehicleRacingMgr.checkPointsRoot)
                {
                    vehicleRacingMgr.checkPointsRoot.gameObject.SetActive(enable);
                }
            }
        }
    }
}